class Solution(object):
    def winnerOfGame(self, colors):
        n = len(colors)
        left = 0
        right = 0
        c1 = 0
        c2 = 0
        while right < n:
            if colors[right] == colors[left]:
                if right - left >= 2:
                    if colors[left] == 'A':
                        c1 += 1
                    else:
                        c2 += 1
            else:
                left = right
            right += 1
        return c1 > c2